package dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import model.User;
@Repository
public class UserDaoImpl extends BaseDao implements UserDao{
	

	@Override
	public void save(User user) {
		String sql="insert into user(id,name) values(?,?)";
		super.getJdbcTemplate().update(sql, user.getId(),user.getName());
		log.info("保存:"+user.toString());
		
	}

	@Override
	public List<User> findAll() {
		String sql="select * from user";
		
		return super.getJdbcTemplate().queryForList(sql, User.class);
	}	

}
